package p0;

public class Leetcode_9 {
    public static boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        if (x < 10) {
            return true;
        }
        if (x % 10 == 0) {
            return false;
        }
        return Long.valueOf(new StringBuilder(String.valueOf(x)).reverse().toString()) == (long) x;
    }

    public static void main(String[] args) {
        System.out.println(isPalindrome(10));
    }
}